import list from './data/index';
Page({
    data: {
        list,
    },
    onLoad(options) {
        // console.log("组件初始化",options);
    },
    clickHandle(e) {
        const {path} = e.detail;
        // console.log('点击导航栏',path)
        wx.navigateTo({
            url: path,
            fail: (e) => {
                wx.redirectTo({
                    url: './home',
                });
            },
        });
    },
    getQueryByUrl(url) {
        const data = {};
        const queryArr = `${url}`.match(/([^=&#?]+)=[^&#]+/g) || [];
        if (queryArr.length) {
            queryArr.forEach((para) => {
                const d = para.split('=');
                const val = decodeURIComponent(d[1]);
                if (data[d[0]] !== undefined) {
                    data[d[0]] += `,${val}`;
                }
                else {
                    data[d[0]] = val;
                }
            });
        }
        return data;
    },
});
